#include "MkPtzCommand.h"

CMkPtzCommand CMkPtzCommand::m_Instance;
CMkPtzCommand::CMkPtzCommand()
{
    m_MapPtzCommand["PtzStop"] = PtzStop;
    m_MapPtzCommand["PtzUp"] = PtzUp;
    m_MapPtzCommand["PtzDown"] = PtzDown;
    m_MapPtzCommand["PtzLeft"] = PtzLeft;
    m_MapPtzCommand["PtzRight"] = PtzRight;
    m_MapPtzCommand["PtzZoomIn"] = PtzZoomIn;
    m_MapPtzCommand["PtzZoomOut"] = PtzZoomOut;
    m_MapPtzCommand["PtzFocusNear"] = PtzFocusNear;
    m_MapPtzCommand["PtzFocusFar"] = PtzFocusFar;
    m_MapPtzCommand["PtzApertureOpen"] = PtzApertureOpen;
    m_MapPtzCommand["PtzApertureClose"] = PtzApertureClose;
    m_MapPtzCommand["PtzGotoPreset"] = PtzGotoPreset;
    m_MapPtzCommand["PtzSetPreset"] = PtzSetPreset;
    m_MapPtzCommand["PtzDelPreset"] = PtzDelPreset;
    m_MapPtzCommand["PtzLightTurnOn"] = PtzLightTurnOn;
    m_MapPtzCommand["PtzLightTurnOff"] = PtzLightTurnOff;
    m_MapPtzCommand["PtzWiperTurnOn"] = PtzWiperTurnOn;
    m_MapPtzCommand["PtzWiperTurnOff"] = PtzWiperTurnOff;
    m_MapPtzCommand["PtzFanTurnOn"] = PtzFanTurnOn;
    m_MapPtzCommand["PtzFanTurnOff"] = PtzFanTurnOff;
    m_MapPtzCommand["PtzHeaterTurnOn"] = PtzHeaterTurnOn;
    m_MapPtzCommand["PtzHeaterTurnOff"] = PtzHeaterTurnOff;
    m_MapPtzCommand["PtzAuxTurnOn"] = PtzAuxTurnOn;
    m_MapPtzCommand["PtzAuxTurnOff"] = PtzAuxTurnOff;
    m_MapPtzCommand["PtzLeftUp"] = PtzLeftUp;
    m_MapPtzCommand["PtzRightUp"] = PtzRightUp;
    m_MapPtzCommand["PtzLeftDown"] = PtzLeftDown;
    m_MapPtzCommand["PtzRightDown"] = PtzRightDown;
    m_MapPtzCommand["PtzHorseCtorAutoScan"] = PtzHorseCtorAutoScan;
    m_MapPtzCommand["PtzVerseCtorAutoScan"] = PtzVerseCtorAutoScan;
    m_MapPtzCommand["PtzCruiseFillPre"] = PtzCruiseFillPre;
    m_MapPtzCommand["PtzCruiseSetDwell"] = PtzCruiseSetDwell;
    m_MapPtzCommand["PtzCruiseSetSpeed"] = PtzCruiseSetSpeed;
    m_MapPtzCommand["PtzCruiseClearPre"] = PtzCruiseClearPre;
    m_MapPtzCommand["PtzCruiseRun"] = PtzCruiseRun;
    m_MapPtzCommand["PtzCruiseClear"] = PtzCruiseClear;
    m_MapPtzCommand["Ptz3DZoom"] = Ptz3DZoom;
}

Uint32 CMkPtzCommand::GetPtzCommand(const MkString& PtzCmd, PtzCommand& Cmd) const
{
    MkUnorderedMap<MkString, PtzCommand>::const_iterator it = m_MapPtzCommand.find(PtzCmd);
    if (it != m_MapPtzCommand.end()) {
        Cmd = it->second;
        return NoneError;
    }
    return InvalidParams;
}

CMkPtzCommand::~CMkPtzCommand()
{
}